package com.ming_za.odupdaterserver.core.controller.cmd;

import com.ming_za.odupdaterserver.core.mco_core.API.CmdOperate;
import com.ming_za.odupdaterserver.core.mco_core.Cmd.CmdCreate;

import java.util.Map;

@CmdCreate(cmd = "thread",hide = true)
public class ShowThreadCmd implements CmdOperate {
    @Override
    public boolean onCommand(String command, String[] args) {
        for (Map.Entry<Thread, StackTraceElement[]> entry : Thread.getAllStackTraces().entrySet()){
            System.out.println(entry.getKey().getName() + (entry.getKey().isDaemon() ? " - 守护线程" : ""));
        }
        return true;
    }
}
